export class Pipe{
    pipe: Buffer = Buffer.alloc(0);

    pack(data: any){
        const body = Buffer.from(JSON.stringify(data));
        const header = Buffer.alloc(4);

        header.writeUInt16BE(body.length);
        const packet = Buffer.concat([header, body]);
        return packet;
    }
}